/**
 * 
 */
package cn.edu.cqu.bysj.wm.def;

/**
 * @author Meng
 * 
 */
public interface ConstDef {

	// direction string
	public static final String DIRECTION_OUTPUT = "出度传播";
	public static final String DIRECTION_INPUT = "入度传播";
	public static final String DIRECTION_DOUBLE = "双向传播";

	// database path
	public static final String GN_DB_PATH = "graphDb/neo4j-graph-gn-db";
	public static final String LP_DB_PATH = "graphDb/neo4j-graph-lp-db";
	public static final String TREE_DB_PATH = "graphDb/neo4j-tree-db";

	// output file path
	public static final String OUTPUT_FILE = "output/output";

	// minimum community size
	public static final int MIN_COMMUNITY_SIZE = 3;

	// gn judge partition results
	public static final int PARTITION_OK = 0;
	public static final int ONLY_DELETE_EDGE = 1;
	public static final int LESS_THAN_TTREE = 2;

	// strength type of community define
	public static int NEITHER = 0;
	public static int STRONG_COMMUNITY = 1;
	public static int WEAK_COMMUNITY = 2;

	// key nodes evaluate index
	public static int DEGREE = 0;
	public static int BETWEENNESS = 1;
	public static int STRESS = 2;
	public static int CLOSENESS = 3;
	public static int CLUSTER = 4;
	public static int PAGERANK = 5;

	// global key node or local
	public static int GLOBAL_KEY_NODE = 0;
	public static int LOCAL_KEY_NODE = 1;

	// skyline or fagin
	public static int SKYLINE = 0;
	public static int FAGIN = 1;

	// lp max iteration time
	public static final int ITERATE_TIME = 10;

	// detection type string
	public static final String SQ_TYPE_STRING = "社区发现算法";
	public static final String JD_TYPE_STRING = "关键节点算法";

	// detection type enum
	public enum ConfigType {
		SQ, JD;
		public String toString() {
			switch (this) {
			case SQ:
				return SQ_TYPE_STRING;
			case JD:
				return JD_TYPE_STRING;
			default:
				return null;
			}
		}
	}

	// lp or gn
	public static int GN = 0;
	public static int LP = 1;

	// algorithm type string
	public static final String GN_ALGORITHM_STRING = "GN算法";
	public static final String LP_ALGORITHM_STRING = "LP算法";
	public static final String FAGIN_ALGORITHM_STRING = "Fagin算法";
	public static final String SKYLINE_ALGORITHM_STRING = "skyline算法";

	// algorithm type enum
	public enum AlgorithmType {
		GN, LP, FAGIN, SKYLINE;
		public String toString() {
			switch (this) {
			case GN:
				return GN_ALGORITHM_STRING;
			case LP:
				return LP_ALGORITHM_STRING;
			case FAGIN:
				return FAGIN_ALGORITHM_STRING;
			case SKYLINE:
				return SKYLINE_ALGORITHM_STRING;
			default:
				return null;
			}
		}

		/**
		 * judge algorithm type
		 * 
		 * @param str
		 * @return type
		 */
		public static AlgorithmType valueOfType(String str) {
			if (str.equals(GN_ALGORITHM_STRING)) {
				return GN;
			} else if (str.equals(LP_ALGORITHM_STRING)) {
				return LP;
			} else if (str.equals(FAGIN_ALGORITHM_STRING)) {
				return FAGIN;
			} else if (str.equals(SKYLINE_ALGORITHM_STRING)) {
				return SKYLINE;
			}
			return null;
		}
	}

	// key node detection type string
	public static final String LOCAL_KEY_NODE_STRING = "局部关键节点发现";
	public static final String GLOBAL_KEY_NODE_STRING = "全局关键节点发现";

	// key node detection type enum
	public enum KeyNodeType {
		GLOBAL, LOCAL;
		public String toString() {
			switch (this) {
			case GLOBAL:
				return GLOBAL_KEY_NODE_STRING;
			case LOCAL:
				return LOCAL_KEY_NODE_STRING;
			}
			return null;
		}
	}
	
	// community detection algorithm enum
	public enum AlgrithismType{
		GN,LP;
		public String toString(){
			
			switch (this) {
			case GN:
				return "GN";
			case LP:
				return "LP";
			default:
				return null;
			}
		}
	}
}
